export const SET_VISIBILITY_FILTER = "SET_VISIBILITY_FILTER";
export const ADD_TODO = "ADD_TODO";
export const TOGGLE_TODO = "TOGGLE_TODO";

export const FILTER_SHOW_ALL = "SHOW_ALL";
export const FILTER_SHOW_COMPLETED = "SHOW_COMPLETED";
export const FILTER_SHOW_ACTIVE = "SHOW_ACTIVE";

export function setVisibilityFilter(filter){
    return {type:SET_VISIBILITY_FILTER,filter}
}

export const addTodo = text =>{
    return {type:ADD_TODO,text,completed:false}
}

export const toggleTodo = (id,completed)=>{
    return {
        type:TOGGLE_TODO,
        id,
        completed
    }
}
